import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.GeneralPath;

public class Celulas extends javax.swing.JFrame {
    int ancho=25;
    Color color= Color.GRAY;
    GeneralPath [] formas = new GeneralPath[4];
    
    
    public Celulas() {
        initComponents();
        this.setSize(850, 600);
        
        GeneralPath curveTo= new GeneralPath();//con esto definimos nuestro dibujo
        
        GeneralPath path1 = new GeneralPath();
        
        GeneralPath gp7 = new GeneralPath();
        GeneralPath gp6 = new GeneralPath(); 
     
        
        
        
// FORMA CILIADA    
  path1.moveTo(150,290);
  path1.quadTo(160, 240, 125, 240);
  path1.quadTo(75, 225,60, 170);
  path1.quadTo(65, 140, 110, 140);
  path1.quadTo(140,125,90,80);
  path1.quadTo(80, 90,60, 125);
  path1.quadTo(75, 60, 100, 60);
  path1.quadTo(140, 80, 130, 130);
  path1.quadTo(60, 180, 140, 210);
  path1.quadTo(180, 225, 150, 290);
  formas[0]= path1;
  path1= new GeneralPath(); 

// FORMA ALARGADA
  path1.moveTo(180,125);
  path1.quadTo(130,75, 90, 125);//forma arco superior
  path1.lineTo(90,325);//linea vertical
  path1.quadTo(130,375,180,325);//forma el arco inferior
  path1.lineTo(180, 125);//2da linea vertical
  path1.lineTo(90, 125);//x y
  
  path1.lineTo(180, 125);//Creacion de anillos
  path1.moveTo(90,160);
  path1.lineTo(180, 160);
  path1.moveTo(90,215);
  path1.lineTo(180, 215);
  path1.moveTo(90,270);
  path1.lineTo(180, 270);
  path1.moveTo(91,328);
  path1.lineTo(180, 328);
  path1.moveTo(93,120);
  path1.lineTo(178, 120);
  formas[1]= path1;
  path1= new GeneralPath(); 
  
  
  
  
  


   // FORMA ESTRELLADA     
  path1.moveTo(40,260);
  
  path1.quadTo(125,210, 40, 170);
  path1.quadTo(110,160,80 , 90);
  path1.quadTo(140,130, 185, 60);
  path1.quadTo(175,150, 240, 135);
  path1.quadTo(190,220, 260, 210);
  path1.quadTo(160,220, 190, 280);
  path1.quadTo(130,210, 40, 260);
 // path1.quadTo(180,260, 60, 240);
 formas[2]= path1;
  path1= new GeneralPath(); 
       
  //FORMA CILINDRICA
  path1.moveTo(100,125);
  path1.quadTo(75,100, 100, 75);
  path1.lineTo(275,75);
  path1.quadTo(300, 100, 275, 125);
  path1.lineTo(100, 125);
  formas[3]= path1;
  path1= new GeneralPath(); 
 
 /*
 g2.drawOval(100, 200, 10, 10);
 path1.curveTo(150, 100,450,100,500,200);//x1,y1,x2,y2,x3,y3
 g2.drawOval(150, 100, 10, 10);
 g2.drawOval(250, 100, 10, 10);
 g2.drawOval(300, 200, 10, 10);
 gp7.moveTo(500, 200);
 gp7.curveTo(450, 300,150,300,100,200);
 
 
  
    g2.draw(path1);
    g2.draw(gp7);
    
    g2.drawOval(250, 250, 10, 10);*/
      //gp7.moveTo(150.0f,150.0f);
      //gp7.quadTo(100.0f,200, 200,270);
     //gp6.moveTo(150.0f,200.0f);
     //gp6.quadTo(200,120, 330,270.0f);
    

      //dibujamos

      
      //g2.draw(gp6);
      
      //g2.draw(path1);

        
        
        
                
                }
    
        

    public void paint(Graphics g){
        super.paintComponents(g);//llamada al constructor de la clase padre
        
        Graphics2D g2 = (Graphics2D)g;//con esto vamos a dibujar 
        
        
        g.translate(175,90);//transporte para poner medidas.
for(int i=10;i<1500;){ //medida en X
g.drawString(""+(i-10), i, 0);
i+=ancho;
}
for(int j=10;j<1000;){//medida en Y
if(j!=10)
g.drawString(""+(j-10), 0, j);
j+=ancho;
}

g.translate(25,10);//nos trasladamos para empezar a dibujar
g.setColor(Color.GRAY);
for(int i = 0 ; i<1500;){//lineas verticales
g.drawLine(i,0, i, 1000);//(x0,y0,x1,y1);
i+=ancho;
}
for(int j=0;j<1000;){//lineas horizontales
g.drawLine(0, j, 1500,j);//(x0,y0,x1,y1);
j+=ancho;
}
        
         //g2.setStroke(new BasicStroke(BasicStroke.JOIN_ROUND));




 






g3.fill(null);

g2.draw(formas[3]);
 


    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Celulas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Celulas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Celulas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Celulas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Celulas().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
